<?php
class AlunoDAO{ 
    private $host = "mysql:host=localhost;port=3306;dbname=teste";
    private $user = "root";
    private $senha = "";
        
    public function __construct(){}
    
    public function TestaCpf($cpf){}    
    
    public function Insere(Aluno $aluno){}
    
    public function ListaTodos(){}    
  
    public function Excluir ($id){}


    public function Editar(Aluno $aluno){
        try{
            $con = new PDO($this->host,$this->user,$this->senha);
            $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            $con -> exec("set names utf8");

            $sql = "UPDATE aluno SET nome=?,cpf=? WHERE cpf=? ";
            
            $stmt = $con->prepare($sql);
            $stmt->bindValue(1,$aluno->getNome());
            $stmt->bindValue(2,$aluno->getCpf());
            $stmt->bindValue(3,$aluno->getIdade());
            $stmt->execute();
        }
        catch (Exception $e){
            echo $e->getMessage();
        }
    }
}
?>

?>